//
//  Utilities.swift
//  EyeVisionForPatients
//
//  Created by PMC on 2022/11/3.
//  Copyright © 2022 QDSG. All rights reserved.
//

import UIKit

struct Utilities {
    /// 获取app版本号
    static func getLocalAppVersion() -> String {
        guard let infoDict = Bundle.main.infoDictionary,
            let versionStr = infoDict["CFBundleShortVersionString"] as? String else {
                return ""
        }
        return versionStr
    }
    
    /// 版本比较, true - 正在审核 false - 线上版本
    static func compareVersion(check version1: String, local version2: String) -> Bool {
        return version1 == version2
    }
    
    /// 是否跳登录页
    static func pushLoginVc(_ target: UIViewController?) {
        guard !UserDefaults.token.isEmpty else {
            AppDelegate.logout(inSelf: false)
            return
        }
    }
}
